package dao.hibernate;

import dao.common.ShopRepository;
import models.Shop;
import models.ShopOwner;
import play.db.jpa.JPA;

public class ShopRepositoryImpl implements ShopRepository {
    public long add(Shop shop) {
        JPA.em().persist(shop);
        return shop.id;
    }

    public Shop getById(long id) {
        return JPA.em().find(Shop.class, id);
    }

    public void attachOwnerToShop(long shopId, ShopOwner owner) {
        //To change body of implemented methods use File | Settings | File Templates.
    }
}
